package com.tiger.userClient.http.deptContacts;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.tiger.db.entity.DeptContacts;
import com.tiger.userClient.Db;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

@Service
public class DeptContactsService {
    private final Db db;

    public DeptContactsService(Db db) {
        this.db = db;
    }

    public List<DeptContacts> list() {

        return db.deptContacts.list(new LambdaQueryWrapper<DeptContacts>().select(DeptContacts::getId, DeptContacts::getDept));
    }

    public DeptContacts contacts(Integer id) {
        return db.deptContacts.getOne(new LambdaQueryWrapper<DeptContacts>().eq(DeptContacts::getId, id));
    }
}
